-- GENERATED SPELL FOR [Plagued Bat] --


function spell0_16037(pUnit, Event) --@Putrid Bite,n/a--
pUnit:FullCastSpellOnTarget(30113,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16037', 30307, 1)
end

function spell1_16037(pUnit, Event) --@Putrid Bite,n/a--
pUnit:FullCastSpellOnTarget(54772,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16037', 30350, 1)
end

function Sorts_16037(pUnit, Event)
local choix_sorts_16037 = math.random(0, 1)
if choix_sorts_16037 == 0 then
pUnit:RegisterEvent('spell0_16037', 1, 1)
end
if choix_sorts_16037 == 1 then
pUnit:RegisterEvent('spell1_16037', 1, 1)
end
end

function mob16037_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_16037', math.random(1500, 3000), 1)
end

function mob16037_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16037_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16037_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(16037, 1, 'mob16037_Action')
RegisterUnitEvent(16037, 2, 'mob16037_Leave')
RegisterUnitEvent(16037, 3, 'mob16037_Kill')
RegisterUnitEvent(16037, 4, 'mob16037_Die')
